//
//  CommonDefine.h
//  Meets-ios
//
//  Created by liumingkong on 14-6-22.
//  Copyright (c) 2014年 meets. All rights reserved.
//

#import <Foundation/Foundation.h>

static NSString *const FEMALE_AVATAR_FID = @"1000000000";
static NSString *const MALE_AVATAR_FID   = @"2000000000";

#define SHARE_SDK_KEY @"2a981ebf1750"

#define SHARE_SDK_FACEBOOK_KEY          @"544737128982725"
#define SHARE_SDK_FACEBOOK_SECRETKEY    @"bae0a8085e9369ddf1af3514a6936f25"
#define IS_IOS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
#define IS_IOS_9_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)
#define APPLE_ID    @"908023218"

#define STRANGER_AVATAR_FID     @"1411720954117"

#define AppStoreURLFormat       @"itms-apps://itunes.apple.com/app/id%@"
#define FacebookMainPage        @"http://www.facebook.com/micoapp"
#define UserMinAge              18
#define UserMaxAge              80

#define FB_IAD_FUNCTIONVC_PLACEMENTID                   @"544737128982725_843884685734633"
#define FB_IAD_MEBACK_PLACEMENTID                       @"544737128982725_868441203278981"
#define FB_NATIVE_AD_PROFILEMOMENT_PLACEMENTID          @"544737128982725_843884009068034"
#define FB_NATIVE_AD_PROFILEPHOTO_PLACEMENTID           @"544737128982725_843883859068049"
#define FB_NATIVE_AD_MOMENT_PLACEMENTID                 @"544737128982725_802489243207511"
#define FB_NATIVE_AD_GIFTBOX_PLACEMENTID                @"544737128982725_868441339945634"
#define FB_NATIVE_AD_NEARBY_PLACEMENTID                 @"544737128982725_803743916415377"
#define FB_NATIVE_AD_CONVERSATION_PLACEMENTID           @"544737128982725_868439913279110"

#define AUDIO_RECORD_RATE 8000.f
#define AUDIO_RECORD_BIT  16
#define AUDIO_RECORD_CHANNEL_NUM 1

//#define EMOJI_PAGE_SIZE 21
#define APP_PAGE_CONTROL_HEIGHT 12.0f
#define APP_PAGE_CONTROL_BOTTOM 45.0f

#define HideViewIfExist(view) {!view ? : [view setHidden:YES];}
#define RemoveViewIfExist(view) {if(view && [view superview]) {[view removeFromSuperview]; view = nil;}}

// 由于单例代码相似，因此采用宏的方式定义
#define DEFINE_SINGLETON_FOR_HEADER(className)\
+(className *)shared##className;


#define DEFINE_SINGLETON_FOR_CLASS(className)\
+(className *)shared##className {\
    static className *shared##className = nil;\
    static dispatch_once_t onceToken;\
    dispatch_once(&onceToken, ^{\
        shared##className = [[self alloc] init];\
    });\
    return shared##className;\
}